<template>
	<view class="df_property">
		<view class="df_property_head">
			<u-icon name="arrow-left" color="#fff" size="40" @click="returnPage" class="return_pages"></u-icon> 
			<image :src="'https://community.chuangxiangdianli.com/images/propertyImg/wu_banner.png'" mode=""></image>
			<image class="df_pro_img" :src="'https://community.chuangxiangdianli.com/images/propertyImg/wu_ren.png'" mode=""></image>
			<text class="head_title">物业服务</text>
		</view>
		
		<view class="df_property_con">
			<view class="con_tit">
				<text>hi, 欢迎使用物业服务</text>
				<text>{{roomInfo || '暂无'}}</text>
			</view>
			<view class="con_nav">
				<navigator 
					class="con_item" 
					v-for="item in propertyNav" 
					:key="item.text" 
					:url="item.url"
					hover-class="none"
					>
					<image class="con_item_img" :src="item.img" mode=""></image>
					<text>{{item.text}}</text>
				</navigator>
			</view>
			
			<view class="df_shortcut">
				<view class="shortcut_fl" @click="goToAnnounce"> 
					<image class="shortcut_fl_img" :src="'https://community.chuangxiangdianli.com/images/propertyImg/home_gong.png'" mode=""></image>
					<view class="shortcut_fl_info">
						<text>小区公告</text>
						<text>了解更多新事儿</text>
					</view>
				</view>
				<view class="shortcut_fr" @click="goToComplaints">
					<image class="shortcut_fr_img" :src="'https://community.chuangxiangdianli.com/images/propertyImg/home_tou.png'" mode=""></image>
					<view class="shortcut_fr_info">
						<text>物业投诉</text>
						<text>反馈问题给我哦</text>
					</view>
				</view>
			</view>
			
<!-- 			<view class="df_notice" @click="goToAnnounce">
				<view class="notice_fl">
					<image class="notice_fl_img" :src="'https://community.chuangxiangdianli.com/images/propertyImg/home_tongzhi.png'" mode=""></image>
					<text class="notice_fl_tz">通知</text>
				</view>
				<view class="notice_fr">
					<text class="notice_fr_top">关于小区停水通知</text>
					<text class="notice_fr_con">关于小区停水通知停水通知停水通知停关于小区停水通知停水通知停水通知停</text>
				</view>
			</view> -->
		</view>
		
		<view class="df_property_foo">
			<view class="foo_one">
				<image class="foo_one_img" :src="'https://community.chuangxiangdianli.com/images/propertyImg/kefu@2x.png'" mode=""></image>
				<text>0531-888888001</text>
			</view>
			<view class="foo_tow">
				服务时间：9:00~18:00
			</view>
		</view>
	</view>
</template>

<script>
	import { getStorages } from '@/utils/storage'
	export default {
		data() {
			return {
				// 小区名称
				roomInfo: '',
				// 小区业主id
				propertId: null,
				// 小区通知
				announcement: null,
				propertyNav: [
					{
						img: 'https://community.chuangxiangdianli.com/images/propertyImg/shuifei@2x.png',
						text:'水费', 
						url: '/property/feePage/index?type='+'water' 
					},
					{img: 'https://community.chuangxiangdianli.com/images/propertyImg/dianfei@2x.png',text:'电费', url: '/property/feePage/index?type=' + 'electric'},
					{img: 'https://community.chuangxiangdianli.com/images/propertyImg/wuye@2x.png',text:'物业费', url: '/property/propertyFee/index'},
					{img: 'https://community.chuangxiangdianli.com/images/propertyImg/baoxiu@2x.png',text:'在线报修', url: '/property/proReport/index'}
				]
			};
		},
		onShow() {
			if(getStorages('userInfo')){
				this.roomInfo = getStorages('userInfo').userInfo.community + getStorages('userInfo').userInfo.roomInfo 
				this.propertId = getStorages('userInfo').userInfo.community_id
			} 
			// 获取小区通知
			this.getAnnouncement()
		},
		methods:{
			goToAnnounce(){ 
				uni.navigateTo({
					url: './announce/index'
				})
			},
			goToComplaints(){
				uni.navigateTo({
					url: './complaints/index'
				})
			},
			// 返回上一页
			returnPage(){
				uni.switchTab({
					url: '/pages/home/index'
				})
			},
 
			// 小区通知
			getAnnouncement(){
				this.$mrequest2({
					url: 'Mini/property/announcement'
				}).then(res => {
				if(res.code == 200){
					console.log(res)
				}
			})
			} 
		}
	}
</script>

<style lang="scss" scoped>
.df_property{
	height: 100vh;
	.df_property_head{
		// padding-top: var(--status-bar-height);
		position: relative;
		height: 530rpx;
		.df_pro_img{
			position: absolute;
			left: 60rpx;
			bottom: -10rpx;
			width: 62rpx;
			height: 118rpx;
			z-index: 10;
		}
		.head_title{
			position: absolute;
			top: 20%;
			left: 50%;
			font-size: 34rpx;
			color: #fff;
			font-weight: 700;
			transform: translate(-50%,-50%);
			z-index: 10;
		}
		.return_pages{
			position: absolute;
			left: 30rpx;
			top: 84rpx;
		}
	}
	
	.df_property_con{
		position: relative;
		top: -30rpx;
		padding: 50rpx 32rpx;
		height: calc(100% - 614rpx);
		background-color: #fff;
		border-radius: 40rpx 40rpx 0rpx 0rpx;
		.con_tit{
			display: flex;
			justify-content: space-between;
			height: 100rpx;
			font-size: 31rpx;
			color: #333;
			& text:nth-child(2){
				font-size: 24rpx;
				color: #666;
			}
		}
		.con_nav{
			display: flex;
			justify-content: space-around;
			height: 150rpx; 
			.con_item{
				flex: 1;
				// width: 96rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				text-align: center;
				.con_item_img{ 
					margin: 0 auto;
					width: 96rpx;
					height: 96rpx;
				}
			}
		}
		.df_shortcut{
			display: flex;
			justify-content: space-between;
			margin-top: 78rpx;
			height: 175rpx; 
			view {
				position: relative;
				width: 335rpx;
				.shortcut_fl_info{
					position: absolute;
					top: 30rpx;
					left: 20rpx;
					color: #fff;
					font-size: 34rpx;
					& text:nth-child(1){
						display: block;
					}
					& text:nth-child(2){
						font-size: 24rpx;
					}
				}
				.shortcut_fr_info{
					position: absolute;
					top: 30rpx;
					left: 20rpx;
					color: #fff;
					font-size: 34rpx;
					& text:nth-child(1){
						display: block;
					}
					& text:nth-child(2){
						font-size: 24rpx;
					}
				}
			} 
		}
		.df_notice{
			display: flex;
			justify-content: space-between;
			padding: 14rpx 30rpx;
			margin-top: 40rpx;
			height: 120rpx;
			background-color: #f2f2f2;
			border-radius: 20rpx;
			.notice_fl{
				width: 140rpx;
				line-height: 94rpx;
				border-right: 1rpx solid #999;
				.notice_fl_img{ 
					position: relative;
					top: -6rpx;
					margin-right: 10rpx;
					width: 36rpx;
					height: 45rpx;
					vertical-align: middle;
				}
				.notice_fl_tz{
					font-size: 32rpx;
					font-weight: 700;
					color: #333;
				}
			}
			.notice_fr{
				padding-top: 10rpx;
				width: 450rpx;
				font-size: 26rpx;
				overflow: hidden;
				text-overflow:ellipsis;
				white-space: nowrap;
				.notice_fr_top{
					display: block;
				}
				.notice_fr_con{ 
				}
			}
		}
	}
	
	.df_property_foo{
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 134rpx;
		font-size: 32rpx;
		text-align: center;
		border-top: 5rpx solid #B6B6B6;
		background-color: #f7f8f9;
		.foo_one{
			height: 86rpx;
			line-height: 86rpx;
			.foo_one_img{
				margin-right: 30rpx;
				width: 80rpx;
				height: 70rpx;
				&::before{
					position: absolute;
					left: 210rpx;
					bottom: 40rpx;
					content: '客服';
					font-size: 22rpx;
				}
			}
		}
		.foo_tow{
			font-size: 24rpx;
		}
	}
}
</style>
